<script type="text/javascript">
<!--
$(document).ready(function(){
    $('.del_product').click(function(){
        i = $(this);
        if (!confirm('Bạn có chắc chắn muốn xóa sản phẩm này không ?')){
            return false;
        }
        $.post(ADMIN_URL+'/product/delete', {id: i.attr('_id')}, function(data){
            if (data == true){
                i.parent().parent().remove();
            }
        });
    });

    $('.hover').popover({
    	html: true
    })
});
//-->
</script>
<div class="content_wrapper">
    <legend>Danh sách nhóm tin tức</legend>
    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered table-condensed" id="example" width="100%">
        <thead>
            <tr>
                <th width="25" style="text-align: center;">ID</th>
                <th>Tiêu đề nhóm tin tức</th>
                <th width="70" style="text-align: center;">Tùy chọn</th>
            </tr>
        </thead>
        <tbody>
            <?php if (count($result) > 0):?>
            <?php foreach($result as $key => $value) :?>
             <tr>
                <td><?php echo $value->category_id;?></td>
                <td><?php echo $value->title;?></td>
                <td style="text-align: center;">
                    <a href="<?php echo base_url('admin/news_category/edit/'.$value->category_id);?>"><i class="icon-edit"></i></a>
                    <a href="javascript: void(0);" _id="<?php echo $value->category_id;?>" class="del_product"><i class="icon-remove"></i></a>
                </td>
            </tr>
            <?php endforeach;?>
            <?php else:?>
            <tr><td colspan="10">Chưa có dữ liệu nhóm tin tức</td></tr>
            <?php endif;?>
        </tbody>
    </table>
</div>
